﻿<%@ Page Title="" Language="C#" MasterPageFile="~/iFrameMasterPage.master" AutoEventWireup="true" CodeFile="EmployeeEditor.aspx.cs" Inherits="EmployeeEditor" %>

<%@ Register src="Ctl/ctlLoginEditor.ascx" tagname="ctlLoginEditor" tagprefix="uc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="cphHead" Runat="Server">
<table width ="100%" cellpadding ="1" cellspacing ="1" >
    <tr >
        <td style ="width :20px" >            
            <asp:Image ID="Image1" ImageUrl ="~/images/Calendar_scheduleHS.png" runat="server" />
        </td>
        <td style ="text-align :left;font-weight :bold"  >
            Карточка сотрудника
        </td>
        <td style ="text-align :center;font-weight :bold;"  >
            <asp:Label ID="Label4" CssClass="msgAlert" style="display :none "  runat="server" Text="Сохраните изменения"></asp:Label>
        </td>
        <td style ="text-align :right " >
            <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                                            <ContentTemplate>
                                                <asp:LinkButton ID="LinkButton1" onclick="btnSaveExit_Click" runat="server" CssClass="btn">К списку</asp:LinkButton>                                                
                                            </ContentTemplate>
                                        </asp:UpdatePanel>
        </td>
    </tr>
</table> 
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cphBody" Runat="Server">
<asp:UpdatePanel ID="updCommonInfo" runat ="server" UpdateMode ="Conditional" >
<ContentTemplate >
<div class="TblCaption" style ="width:100%; height :25px" onclick ="CaptionToggle('body_CommonInfo','Caption_CommonInfo');"  >    
<table style="width:100%;">
            <tr>
                <td id="Caption_CommonInfo" class ="ArrowDown" >
                    &nbsp;</td>
                <td >
                    Общая информация
                    &nbsp
                </td>
                <td >
                    &nbsp;</td>
            </tr>
        </table>
</div> 
<div id="body_CommonInfo" style ="width:100%" >
<table style="width:100%;" cellpadding ="0" cellspacing ="0">    
    <tr id="trCommonInfo" >
            <td width="25%">
            <table style="width:100%;" cellpadding ="2" cellspacing ="0">        
            <%--GID--%>
            <tr >
            <td width="25%" >
                &nbsp;</td>
            <td style="width:25%" class ="grd_td_item_caption" >
                Фамилия:                
                <asp:RequiredFieldValidator ID="txtFamValidator1" runat="server" 
                    ControlToValidate="txtFirstName" ErrorMessage="*"></asp:RequiredFieldValidator>
                </td>
            <td  class ="grd_td_item" >
                <asp:TextBox ID="txtFirstName" 
                    runat="server" CssClass="RequiredTextBox" Text="<%# Employeer.FirstName %>" Width="99%"></asp:TextBox>
            </td>
            </tr>
            <%--Тип--%>
            <tr >
            <td width="25%" >
                &nbsp;</td>
            <td style="width:25%" class ="grd_td_item_caption" >
                Имя:                
                </td>
            <td  class ="grd_td_item" >
                    <asp:TextBox ID="txtSecondName" 
                    runat="server" CssClass="TextBox" Text="<%# Employeer.SecondName %>" 
                    Width="99%"></asp:TextBox>
            </td>
            </tr>
            <%--Даты--%> 
            <tr >
            <td width="25%" >
                &nbsp;</td>
            <td style="width:25%" class ="grd_td_item_caption" >
                Отчество:</td>
            <td  class ="grd_td_item" >
                
                <asp:TextBox ID="txtLastName" runat="server" CssClass="TextBox" 
                    Text="<%# Employeer.LastName %>" Width="99%"></asp:TextBox>
                
                </td>
            </tr>           
          
            <tr >
            <td width="25%" >
                &nbsp;</td>
            <td style="width:25%" class ="grd_td_item_caption" >
                Email:
                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                    ControlToValidate="txtEmail" ErrorMessage="*"></asp:RequiredFieldValidator>
                
                </td>
            <td  class ="grd_td_item" >
                <asp:TextBox ID="txtEmail" runat="server" CssClass="RequiredTextBox" 
                    Text="<%# Employeer.eMail %>" Width="99%"></asp:TextBox>
                </td>
            </tr>                        
                <tr>
                    <td width="25%">
                        &nbsp;</td>
                    <td class="grd_td_item_caption" style="width:25%">
                        Должность:</td>
                    <td class="grd_td_item">
                        <asp:TextBox ID="txtPosition" runat="server" CssClass="TextBox" 
                            Text="<%# Employeer.Position %>" Width="99%"></asp:TextBox>
                    </td>
                </tr>
            <tr>
            <td width="25%" style ="vertical-align :top ">
                </td>
            <td style="width:25%;vertical-align :top"  class ="grd_td_item_caption" >
                Дополнительно:</td>
                <td  class ="grd_td_item">
                    <asp:TextBox ID="txtComment" runat="server" CssClass="TextBox" Height="47px" 
                        Text="<%# Employeer.Comment %>" TextMode="MultiLine" Width="99%"></asp:TextBox>
                </td>
        </tr>       
        
            <tr >
            <td width="25%" >
                &nbsp;</td>
            <td style="width:25%"  >
                <asp:HiddenField ID="hfLoginValue" runat="server" Value="" />
                </td>
                
            <td   style="text-align :right " >
            <asp:UpdatePanel ID="UpdatePanel3" runat ="server"  >
            <ContentTemplate >            
                <asp:Button ID="btnSaveCommonInfo" runat ="server"  
                    Text ="Сохранить" onclick="btnsave_Click" CssClass="btn_wizard"    />            
            </ContentTemplate> 
            </asp:UpdatePanel>
                </td>
                
            </tr>
            </table>
            
            </td>
        </tr>
</table>
</div> 


</ContentTemplate>
</asp:UpdatePanel>

<asp:Panel ID="AddUserInfo" Visible=<%# ImSavedObject %> runat ="server" > 

<asp:UpdatePanel ID="updLoginInfo" runat ="server" UpdateMode ="Conditional" >
<ContentTemplate >
<div class="TblCaption" style ="width:100%; height :25px" onclick ="CaptionToggle('body_LoginInfo','Caption_LoginInfo');"  >    
<table style ="width:100%;">
            <tr>
                <td id="Caption_LoginInfo" class ="ArrowDown" >
                    &nbsp;</td>
                <td >
                    Login Info
                    &nbsp
                </td>
                <td >
                    &nbsp;</td>
            </tr>
        </table>
</div>
<div id="body_LoginInfo" style ="width:100%" >
<table style="width:100%;" cellpadding ="0" cellspacing ="0">    
    <tr id="trLoginInfo" >
            <td width="25%">
            <table style="width:100%;" cellpadding ="2" cellspacing ="0">        
            
            <tr >
            <td width="25%" >
                &nbsp;</td>
            <td style="width:25%" class ="grd_td_item_caption " >
                Login:
                </td>
            <td  class ="grd_td_item" >
                 <table width="100%" cellpadding ="0" cellspacing ="0">
                    <asp:ListView ID="lvLogin" runat="server" onitemcommand="ItemCommand" 
                         onitemediting="lvLogin_ItemEditing" onitemupdating="lvLogin_ItemUpdating" 
                         onitemcanceling="lvLogin_ItemCanceling">
                <LayoutTemplate>
                       <tr runat="server" id="itemPlaceholder" >
                       </tr>                            
                </LayoutTemplate>
                <ItemTemplate >
                <tr >
                    <td style ="vertical-align :top " >
                           <table width ="100%" >
                            <tr >
                                <td style ="vertical-align :top" rowspan="2">
                                    <%# (Employeer.Login==string .Empty ? "не указан":Employeer.Login)   %>                               
                                </td> 
                              <td style ="text-align :right;  vertical-align :top ;width :25px" >
                                    <asp:ImageButton CommandName ="Edit" ID="ImageButton1" visible =<%# !IsCurrentUser %>  runat="server" 
                                        ImageUrl="~/images/icon-edit.gif" />
                            
                                </td>
                                </tr>                       
                              </table>                     
                    </td>
                </tr>
                </ItemTemplate>
                <EditItemTemplate >
                <tr>
                    <td>
                        <table>                            
                                <tr>                                
                               <td width="15px">
                                    <asp:ImageButton ID="ImageButton2" runat="server" 
                                    ImageUrl="~/images/grd_minus.gif" CommandName="Cancel" Width ="15px" />
                                </td>
                                <td  >                                
                                    <asp:Label ID="errMsg" runat="server" Text="" Font-Bold="True" ForeColor="#FF6666"></asp:Label>
                                </td> 
                            </tr>                            
                        </table>
                    </td>
                </tr>
                <tr >
                    <td>                        
                         <table width ="100%" cellpadding ="0" cellspacing ="0" >                            
                            <tr>
                                <td width="15px">
                                </td> 
                                <td style = "width :50%">
                                    Login:
                                </td>
                                <td >
                                    <asp:TextBox ID="txtLogin" runat="server" CssClass="TextBox" Text=<%# Eval("Login")%>  Width="99%"></asp:TextBox>
                                </td>
                                <td style ="text-align :right;  vertical-align :top ;width :25px" >
                                    <asp:ImageButton CommandName ="Update" ID="ImageButton1" runat="server" 
                                        ImageUrl="~/images/icon-save.gif" />
                                </td> 
                            </tr>
                            <tr>
                                <td width="15px">
                                </td> 
                                <td style = "width :50%">
                                    Password:
                                </td>
                                <td >
                                  <asp:TextBox ID="txtPassword" runat="server" CssClass="TextBox"  Width="99%"></asp:TextBox>
                                </td>
                                <td style ="text-align :right;  vertical-align :top ;width :25px" >                                    
                                    &nbsp
                                </td>
                            </tr>
                            </table>                           
                    </td>
                 </tr> 
                
                </EditItemTemplate>
                
                    </asp:ListView> 
                 </table>                 
            </td>
        </tr>
                <tr>
                    <td width="25%">
                        &nbsp;</td>
                    <td class="grd_td_item_caption" style="width:25%">
                        Роли:</td>
                    <td class="grd_td_item">
                        <asp:CheckBoxList ID="chRoleList" Enabled =<%#  (Employeer.Login.Length>0) %> runat="server">
                        </asp:CheckBoxList>
                    </td>
                </tr>
           <tr >
            <td width="25%" >
                &nbsp;</td>
            <td style="width:25%"  >
                <asp:HiddenField ID="HiddenField1" runat="server" Value="" />
                </td>
                
            <td   style="text-align :right " >
            <asp:UpdatePanel ID="UpdatePanel2" runat ="server"  >
            <ContentTemplate >            
                <asp:Button ID="Button2" runat ="server" CssClass ="btn_wizard" 
                    Text ="Сохранить" onclick="btnsave_Click"    />            
            </ContentTemplate> 
            </asp:UpdatePanel>
                </td>
                
            </tr>
            </table>
            
            </td>
        </tr>
</table>            
</div> 
</ContentTemplate> 
</asp:UpdatePanel> 

<asp:UpdatePanel ID="UpdatePanel5" runat ="server" >
<ContentTemplate >
<div class="TblCaption" style ="width:100%; height :25px" onclick ="CaptionToggle('body_SettingInfo','Caption_SettingInfo');"  >    
<table style="width:100%;">
            <tr>
                <td id="Caption_SettingInfo" class ="ArrowUP" >
                    &nbsp;</td>
                <td >
                    Установки
                    &nbsp
                </td>
                <td >
                    &nbsp;</td>
            </tr>
        </table>
</div>
<div id="body_SettingInfo" style ="width:100%;display :none" >
<table style="width:100%;" cellpadding ="0" cellspacing ="0">         
    <tr id="trSettings" >
            <td width="25%">
            <table style="width:100%;" cellpadding ="2" cellspacing ="0">        
            <%--GID--%>
            <tr >
            <td width="25%" >
                &nbsp;</td>
            <td style="width:25%" class ="grd_td_item" >
                Доступны подразделения:
                </td>
            <td  class ="grd_td_item" >
        <%--<asp:TreeView ID="trPermissions" runat="server"              
            ShowCheckBoxes="All" Width="100%" 
            ontreenodedatabound="trPermissions_TreeNodeDataBound">
        </asp:TreeView>--%>
            </td>
            </tr>
            <tr >
            <td width="25%" >
                &nbsp;</td>
            <td style="width:25%" class ="grd_td_item" >
                Доступны отчеты:
                </td>
            <td  class ="grd_td_item" >        
                &nbsp
            </td>
            </tr>
         
                    
            <tr >
            <td width="25%" >
                &nbsp;</td>
            <td style="width:25%"  >
                &nbsp;</td>
                
            <td   style="text-align :right " >
            <asp:UpdatePanel ID=UpdatePanel4 runat ="server"  >
            <ContentTemplate >            
                <asp:Button ID=Button3 runat ="server" CssClass ="btn_wizard" 
                    Text ="Сохранить" onclick="btnsave_Click"    />            
            </ContentTemplate> 
            </asp:UpdatePanel>
                </td>
                
            </tr>
            </table>
            
            </td>
        </tr>
</table>
</div> 
</ContentTemplate> 
</asp:UpdatePanel> 

<asp:UpdatePanel ID="UpdatePanel7" runat ="server" UpdateMode ="Conditional" >
<ContentTemplate >
<div class="TblCaption" style ="width:100%; height :25px" onclick ="CaptionToggle('body_Clients','Caption_Clients');"  >    
<table style="width:100%;">
            <tr>
                <td id="Caption_Clients" class ="ArrowUP" >
                    &nbsp;</td>
                <td >
                    Курирует
                    &nbsp
                </td>
                <td >
                    &nbsp;</td>
            </tr>
        </table>
</div> 
<div id="body_Clients" style ="width:100%;display :none" >
<table style="width:100%;" cellpadding ="0" cellspacing ="0">    
    <tr id="trClients" >
            <td width="25%">
            <table style="width:100%;" cellpadding ="2" cellspacing ="0">        
            <%--GID--%>
            <tr >
            <td width="25%" >
                &nbsp;</td>
            <td class ="grd_td_item" colspan="2" >
                Список курируемых организаций</td>
            </tr>
         
                    
            <tr >
            <td width="25%" >
                &nbsp;</td>
            <td style="width:25%" >
                &nbsp;</td>
                
            <td   style="text-align :right " >
            <asp:UpdatePanel ID=UpdatePanel6 runat ="server"  >
            <ContentTemplate >            
                <asp:Button ID=Button4 runat ="server" CssClass ="btn_wizard" 
                    Text ="Сохранить" onclick="btnsave_Click"    />            
            </ContentTemplate> 
            </asp:UpdatePanel>
                </td>
                
            </tr>
            </table>
            
            </td>
        </tr>
</table>
</div> 

</ContentTemplate> 
</asp:UpdatePanel> 

</asp:Panel> 

    

</asp:Content>

